<?php

use Biz\service\designerAward\Main as sMain;

/**
 * @deprecated
 */
class AddSignAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REALNAME;

    public function main()
    {
        $uid = $this->uid;

        $request = $this->getRequest()->getPost();
        if(!empty($request)){
            foreach($request as $_k=>&$_v){
                $data[$_k] = $_v;
            }
        }

        $data['uid'] = $uid;

        if(empty($data['uid']) && empty($data['areas']) && empty($data['house_type']) && empty($data['house_case'])
            && empty($data['types'])
            && empty($data['descrip'])
        ){
            throw new \Exception('用户,赛区,户型,案例,报名通道或者作品简介不能为空');
        }else{
            $save = sMain::addSign($data);
            if (empty($save['error'])) {
                $result = $save;
                $this->setSuccess($result);
            } else {
                throw new \Exception($save['error']);
            }
        }
    }
}